IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_UserRemoveGroups]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_UserRemoveGroups]
GO
create procedure [dbo].[cms_sp_UserRemoveGroups]
@UserId int,
@UserGroupIds varchar(8000)
as
declare @userGroupLinks table
(
UserId int,
UserGroupId int
)
delete from dbo.UserGroupLinks
where UserGroupId in 
	(select tmp.integer from dbo.cms_udf_SplitIntegers(@UserGroupIds) as tmp)
	and UserId = @UserId


GO

